
# Online Python - IDE, Editor, Compiler, Interpreter



a = int(input('Enter 1st number: '))
if (a<1000 and a>10000):
    print(0)
    
else:
    e=a%10
    d=a%100//10
    s=a%1000//100
    t=a//1000
    
    if(e!=4 and e!=6 and e!=8 and e!=9):
        print(e)
    if(d!=4 and d!=6 and d!=8 and d!=9):
        print(d)
    if(s!=4 and s!=6 and s!=8 and s!=9):
        print(s)
    if(t!=4 and t!=6 and t!=8 and t!=9):
        print(t)
    if(d!=4 and d!=6 and d!=8 and d!=9 and e!=4 and e!=6 and e!=8 and e!=9):
        print(d*10+e)
    if(s!=4 and s!=6 and s!=8 and s!=9 and e!=4 and e!=6 and e!=8 and e!=9):
        print(s*10+e)
    if(s!=4 and s!=6 and s!=8 and s!=9 and d!=4 and d!=6 and d!=8 and d!=9):
        print(s*10+d)
    if(t!=4 and t!=6 and t!=8 and t!=9 and e!=4 and e!=6 and e!=8 and e!=9):
        print(t*10+e)
    if(t!=4 and t!=6 and t!=8 and t!=9 and s!=4 and s!=6 and s!=8 and s!=9):
        print(t*10+s)
    if(t!=4 and t!=6 and t!=8 and t!=9 and d!=4 and d!=6 and d!=8 and d!=9):
        print(t*10+d)


